package com.yuanfeng.activity.controller;


import com.yuanfeng.commoms.dto.goods.ListPageQueryParamDTO;
import com.yuanfeng.commoms.dto.goods.ManjianzengzheGoodsRuleQueryDTO;
import com.yuanfeng.commoms.util.ResponseResult;
import com.yuanfeng.commoms.vo.activity.ManjianzengzheGoodsQueryResultVO;
import com.yuanfeng.commoms.vo.activity.ManjianzengzhePromotionContentQueryResultVO;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName ActivityReductionPolicyBaseController
 * @Description 满减赠折基本信息表
 * @Author cyp
 * @Date 2023-05-25 14:41:45
 * @Version 1.0
 **/
@RestController
@RequestMapping("activity/reductionPolicyBase")
public class ActivityReductionPolicyBaseController extends BaseController{
    /**
     * 查询满减增折活动信息 feign
     */
    @PostMapping("/selectByGoodsId")
    public ManjianzengzheGoodsQueryResultVO selectByGoodsId(@RequestParam("commonId") Integer commonId) {
        ManjianzengzheGoodsQueryResultVO manjianzengzheGoodsQueryResultVO = activityReductionPolicyBaseService.selectByGoodsId(commonId);
        return manjianzengzheGoodsQueryResultVO;
    }

    /**
     * 查询满减增折活动规则
     * @param promotionId
     * @return
     */
    @PostMapping("/selectList")
    public List<ManjianzengzheGoodsRuleQueryDTO> selectList(@RequestParam("promotionId")Integer promotionId){
        List<ManjianzengzheGoodsRuleQueryDTO> manjianzengzheGoodsRuleQueryDTOS = activityReductionPolicyBaseService.selectList(promotionId);
        return manjianzengzheGoodsRuleQueryDTOS;
    }
    /**
     * 查询满减增折 活动内容
     *
     */
    @PostMapping("/selectContent")
    public List<ManjianzengzhePromotionContentQueryResultVO> selectContent(@RequestParam("commonId") Integer commonId){
        List<ManjianzengzhePromotionContentQueryResultVO> manjianzengzhePromotionContentQueryResultVOS = activityReductionPolicyBaseService.selectContent(commonId);
        return manjianzengzhePromotionContentQueryResultVOS;
    }
    /**
     *  查询所有 满减增折商品
     */
    @PostMapping("/selectAll")
    public ResponseResult selectAll(@RequestBody ListPageQueryParamDTO param) {
        ResponseResult select = activityReductionPolicyBaseService.selectAll(param);
        return select;
    }

    /**
     * 查询活动商品价格
     */
    @PostMapping("/selectPrice")
    public ResponseResult selectPrice(@RequestParam Integer goodsId) {
        ResponseResult result = activityReductionPolicyBaseService.selectPrice(goodsId);
        return result;
    }
}

